package com.gaoyuzhe.controller;

import com.gaoyuzhe.entities.Payment;
import com.gaoyuzhe.feign.PaymentFeignService;
import com.gaoyuzhe.to.ReturnValue;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author gaoyuzhe
 */
@RestController
public class OrderController {
    @Resource
    private PaymentFeignService paymentFeignService;

    @GetMapping("/consumer/get/{id}")
    public ReturnValue<Payment> getPayementById(@PathVariable Long id) {
        return paymentFeignService.getPayementById(id);
    }

    @GetMapping("/consumer/timeout")
    public ReturnValue<String> timeout() {
        return paymentFeignService.timeout();
    }
}
